/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RPageUserVo } from '../models/RPageUserVo';
import type { RString } from '../models/RString';
import type { RUserVo } from '../models/RUserVo';
import type { UserDto } from '../models/UserDto';
import type { UserQueryCriteria } from '../models/UserQueryCriteria';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class UserService {

    /**
     * 根据id获取用户信息
     * 查询用户信息，用于个人页面展示
     * @returns RUserVo OK
     * @throws ApiError
     */
    public static queryById(): CancelablePromise<RUserVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/user',
        });
    }

    /**
     * @param requestBody 
     * @returns RString OK
     * @throws ApiError
     */
    public static update(
requestBody: UserDto,
): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'PUT',
            url: '/user',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param requestBody 
     * @returns RPageUserVo OK
     * @throws ApiError
     */
    public static add(
requestBody: UserQueryCriteria,
): CancelablePromise<RPageUserVo> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/user',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * @param uid 
     * @returns RString OK
     * @throws ApiError
     */
    public static delete(
uid: number,
): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/user',
            query: {
                'uid': uid,
            },
        });
    }

    /**
     * 批量获取用户信息
     * 批量获取用户信息，用于页面展示
     * @param requestBody 
     * @returns RPageUserVo OK
     * @throws ApiError
     */
    public static queryAll(
requestBody: UserQueryCriteria,
): CancelablePromise<RPageUserVo> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/user/list',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

}
